package org.taobao.ibatiside.codegen;

import org.taobao.ibatiside.core.genmodel.SpringGenModel;

public class MapV2SpringGen
{
  protected static String nl;
  public static synchronized MapV2SpringGen create(String lineSeparator)
  {
    nl = lineSeparator;
    MapV2SpringGen result = new MapV2SpringGen();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "";
  protected final String TEXT_2 = NL + "<!--@generated-->" + NL + "<bean id=\"";
  protected final String TEXT_3 = "\" class=\"";
  protected final String TEXT_4 = "\">" + NL + "     <property name=”sqlMapClient” ref=”sqlMapClient”/>" + NL + "</bean>";

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
    
	SpringGenModel model = (SpringGenModel)argument;

    stringBuffer.append(TEXT_2);
    stringBuffer.append(model.getId());
    stringBuffer.append(TEXT_3);
    stringBuffer.append(model.getFqn());
    stringBuffer.append(TEXT_4);
    return stringBuffer.toString();
  }
}
